package org.dja.nzw.discovery;

import org.dja.nzw.discovery.domain.InstanceDetails;

import java.util.List;

/**
 * Created by shuyun on 2016/7/19.
 */
public class Test2 {
    public static void main(String[] arges) throws Exception {
        String serviceName = "JustTest";

        DiscoveryClient client = DiscoveryManager.create("192.168.236.128:2181");

        List<InstanceDetails> instances = client.applications(serviceName);

        if(null != instances && instances.size() > 0) {
            for (InstanceDetails ins : instances) {
                System.out.println(ins.getHost() + "  -  " + ins.getEnviroment() + "  -  " + ins.getStatus());
            }
        }

        while (true){
            System.out.println("alive");
        }
    }
}
